//
//  JSDemoTableViewController.m
//  NiubilityProject
//
//  Created by Apple on 2018/3/7.
//  Copyright © 2018年 Apple. All rights reserved.
//

#import "JSDemoTableViewController.h"
#import "LXChatBox.h"
#import "LXEmotionManager.h"
#import <IQKeyboardManager.h>

@interface JSDemoTableViewController ()<LXChatBoxDelegate>

@property (nonatomic, strong) LXChatBox *chatBox;

@end

@implementation JSDemoTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.chatBox =[[LXChatBox alloc]initWithFrame:CGRectMake(0, SCREEN_HEIGHT - HEIGHT_TABBAR, SCREEN_WIDTH, HEIGHT_TABBAR)];
    self.chatBox.maxVisibleLine = 3;
    self.chatBox.delegate = self;
    [self.view addSubview:self.chatBox];
}

-(void)changeStatusChat:(CGFloat)chatBox{
    QMUILog(@"%f", chatBox);
}
-(void)chatBoxSendTextMessage:(NSString *)message{
    NSAttributedString *attribute =[LXEmotionManager transferMessageString:message font:[UIFont systemFontOfSize:16.0] lineHeight:[UIFont systemFontOfSize:16.0].lineHeight];
    QMUILog(@"%@", attribute);
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    //写入这个方法后,这个页面将没有这种效果
    [IQKeyboardManager sharedManager].enableAutoToolbar = NO;
}
- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    //最后还设置回来,不要影响其他页面的效果
    [IQKeyboardManager sharedManager].enableAutoToolbar = YES;
}



@end
